package rpc.server;

import org.apache.hadoop.ipc.ProtocolSignature;
import rpc.StudentNameInterface;

import java.io.IOException;

public class StudentNameImpl implements StudentNameInterface {

    @Override
    public String findName(int studentId) {
        String name = null;
        if (studentId == 1234) name = "张三";
        else if (studentId == 2234) name = "李四";
        else name = "未知";
        System.out.println("客户端请求学生name." + studentId + "->" + name);
        return name;
    }

    @Override
    public long getProtocolVersion(String s, long l) throws IOException {
        return versionID;
    }

    @Override
    public ProtocolSignature getProtocolSignature(String s, long l, int i) throws IOException {
        return null;
    }
}
